<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>shark::BitflipMutator Struct Reference</title>
<script type="text/javaScript" src="search/search.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-mml-chtml.js"></script>
<script src="../../mlstyle.js"></script>
<link href="../css/besser.css" rel="stylesheet" type="text/css"/>
</head>
<!-- pretty cool: each body gets an id tag which is the basename of the web page  -->
<!--              and allows for page-specific CSS. this is client-side scripted, -->
<!--              so the id will not yet show up in the served source code -->
<script type="text/javascript">
    jQuery(document).ready(function () {
        var url = jQuery(location).attr('href');
        var pname = url.substr(url.lastIndexOf("/")+1, url.lastIndexOf(".")-url.lastIndexOf("/")-1);
        jQuery('#this_url').html('<strong>' + pname + '</strong>');
        jQuery('body').attr('id', pname);
    });
</script>
<body>
    <div id="shark_old">
        <div id="wrap">
            <div id="header">
                <div id="site-name"><a href="../../sphinx_pages/build/html/index.html">Shark machine learning library</a></div>
                <ul id="nav">
                    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/installation.html">Installation</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/tutorials/tutorials.html">Tutorials</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/benchmark.html">Benchmarks</a>
                    </li>
                    <li class="active">
                        <a href="classes.html">Documentation</a>
                        <ul>
                            <li class="first"></li>
                            <li><a href="../../sphinx_pages/build/html/rest_sources/quickref/quickref.html">Quick references</a></li>
                            <li><a href="classes.html">Class list</a></li>
                            <li class="last"><a href="group__shark__globals.html">Global functions</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
<div id="doxywrapper">
<!--
    <div id="global_doxytitle">Doxygen<br>Documentation:</div>
-->
    <div id="navrow_wrapper">
<!-- Generated by Doxygen 1.9.8 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceshark.html">shark</a></li><li class="navelem"><a class="el" href="structshark_1_1_bitflip_mutator.html">BitflipMutator</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="structshark_1_1_bitflip_mutator-members.html">List of all members</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a>  </div>
  <div class="headertitle"><div class="title">shark::BitflipMutator Struct Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Bitflip mutation operator.  
 <a href="structshark_1_1_bitflip_mutator.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_bitflip_mutator_8h_source.html">shark/Algorithms/DirectSearch/Operators/Mutation/BitflipMutator.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:afbc4c1396a28cc2b8f26317af44e2625" id="r_afbc4c1396a28cc2b8f26317af44e2625"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structshark_1_1_bitflip_mutator.html#afbc4c1396a28cc2b8f26317af44e2625">BitflipMutator</a> ()</td></tr>
<tr class="memdesc:afbc4c1396a28cc2b8f26317af44e2625"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default c'tor.  <br /></td></tr>
<tr class="separator:afbc4c1396a28cc2b8f26317af44e2625"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4709fc7f40d17f105534b348f925e17" id="r_ae4709fc7f40d17f105534b348f925e17"><td class="memTemplParams" colspan="2">template&lt;typename Function &gt; </td></tr>
<tr class="memitem:ae4709fc7f40d17f105534b348f925e17"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structshark_1_1_bitflip_mutator.html#ae4709fc7f40d17f105534b348f925e17">init</a> (const Function &amp;f)</td></tr>
<tr class="memdesc:ae4709fc7f40d17f105534b348f925e17"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the operator for the supplied fitness function.  <br /></td></tr>
<tr class="separator:ae4709fc7f40d17f105534b348f925e17"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a05a38dc09241ab2eda7c7ff3c2a0593f" id="r_a05a38dc09241ab2eda7c7ff3c2a0593f"><td class="memTemplParams" colspan="2">template&lt;typename Rng , typename <a class="el" href="_t_s_p_8cpp.html#aa2af735cda68526094633853c8a9894d">IndividualType</a> &gt; </td></tr>
<tr class="memitem:a05a38dc09241ab2eda7c7ff3c2a0593f"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structshark_1_1_bitflip_mutator.html#a05a38dc09241ab2eda7c7ff3c2a0593f">operator()</a> (Rng &amp;rng, <a class="el" href="_t_s_p_8cpp.html#aa2af735cda68526094633853c8a9894d">IndividualType</a> &amp;ind)</td></tr>
<tr class="memdesc:a05a38dc09241ab2eda7c7ff3c2a0593f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Mutates the supplied individual.  <br /></td></tr>
<tr class="separator:a05a38dc09241ab2eda7c7ff3c2a0593f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba44f8e8cf6821f292275159de2f6a38" id="r_aba44f8e8cf6821f292275159de2f6a38"><td class="memTemplParams" colspan="2">template&lt;typename Archive &gt; </td></tr>
<tr class="memitem:aba44f8e8cf6821f292275159de2f6a38"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structshark_1_1_bitflip_mutator.html#aba44f8e8cf6821f292275159de2f6a38">serialize</a> (Archive &amp;archive, const unsigned int version)</td></tr>
<tr class="memdesc:aba44f8e8cf6821f292275159de2f6a38"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serializes this instance to the supplied archive.  <br /></td></tr>
<tr class="separator:aba44f8e8cf6821f292275159de2f6a38"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a799d19ef46cefd24798a26fdbef8f6d2" id="r_a799d19ef46cefd24798a26fdbef8f6d2"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structshark_1_1_bitflip_mutator.html#a799d19ef46cefd24798a26fdbef8f6d2">m_mutationStrength</a></td></tr>
<tr class="separator:a799d19ef46cefd24798a26fdbef8f6d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Bitflip mutation operator. </p>
<p>Given a binary vector, a coin is flipped for every element. If it is heads, the element of the vector is flipped. By initializing the mutator with the objective function, this strength is set to a dfault value of 1/dimensions, thus in the mean one element is flipped. </p>

<p class="definition">Definition at line <a class="el" href="_bitflip_mutator_8h_source.html#l00044">44</a> of file <a class="el" href="_bitflip_mutator_8h_source.html">BitflipMutator.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="afbc4c1396a28cc2b8f26317af44e2625" name="afbc4c1396a28cc2b8f26317af44e2625"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afbc4c1396a28cc2b8f26317af44e2625">&#9670;&#160;</a></span>BitflipMutator()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">shark::BitflipMutator::BitflipMutator </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Default c'tor. </p>

<p class="definition">Definition at line <a class="el" href="_bitflip_mutator_8h_source.html#l00047">47</a> of file <a class="el" href="_bitflip_mutator_8h_source.html">BitflipMutator.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ae4709fc7f40d17f105534b348f925e17" name="ae4709fc7f40d17f105534b348f925e17"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae4709fc7f40d17f105534b348f925e17">&#9670;&#160;</a></span>init()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Function &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::BitflipMutator::init </td>
          <td>(</td>
          <td class="paramtype">const Function &amp;&#160;</td>
          <td class="paramname"><em>f</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Initializes the operator for the supplied fitness function. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">f</td><td>Instance of the objective function to initialize the operator for. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_bitflip_mutator_8h_source.html#l00053">53</a> of file <a class="el" href="_bitflip_mutator_8h_source.html">BitflipMutator.h</a>.</p>

<p class="reference">References <a class="el" href="structshark_1_1_bitflip_mutator.html#a799d19ef46cefd24798a26fdbef8f6d2">m_mutationStrength</a>.</p>

</div>
</div>
<a id="a05a38dc09241ab2eda7c7ff3c2a0593f" name="a05a38dc09241ab2eda7c7ff3c2a0593f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a05a38dc09241ab2eda7c7ff3c2a0593f">&#9670;&#160;</a></span>operator()()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Rng , typename <a class="el" href="_t_s_p_8cpp.html#aa2af735cda68526094633853c8a9894d">IndividualType</a> &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::BitflipMutator::operator() </td>
          <td>(</td>
          <td class="paramtype">Rng &amp;&#160;</td>
          <td class="paramname"><em>rng</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="_t_s_p_8cpp.html#aa2af735cda68526094633853c8a9894d">IndividualType</a> &amp;&#160;</td>
          <td class="paramname"><em>ind</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Mutates the supplied individual. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">rng</td><td>Random number generator. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">ind</td><td><a class="el" href="classshark_1_1_individual.html" title="Individual is a simple templated class modelling an individual that acts as a candidate solution in a...">Individual</a> to be mutated. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_bitflip_mutator_8h_source.html#l00062">62</a> of file <a class="el" href="_bitflip_mutator_8h_source.html">BitflipMutator.h</a>.</p>

<p class="reference">References <a class="el" href="namespaceshark_1_1random.html#ada5e9e6fd77534e1d99479213e5fed50">shark::random::coinToss()</a>, <a class="el" href="structshark_1_1_bitflip_mutator.html#a799d19ef46cefd24798a26fdbef8f6d2">m_mutationStrength</a>, and <a class="el" href="classshark_1_1_individual.html#a8d6ed0dfa38f5b0e9debdeb5529e6689">shark::Individual&lt; PointType, FitnessTypeT, Chromosome &gt;::searchPoint()</a>.</p>

</div>
</div>
<a id="aba44f8e8cf6821f292275159de2f6a38" name="aba44f8e8cf6821f292275159de2f6a38"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aba44f8e8cf6821f292275159de2f6a38">&#9670;&#160;</a></span>serialize()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Archive &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::BitflipMutator::serialize </td>
          <td>(</td>
          <td class="paramtype">Archive &amp;&#160;</td>
          <td class="paramname"><em>archive</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned int&#160;</td>
          <td class="paramname"><em>version</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Serializes this instance to the supplied archive. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">archive</td><td>The archive to serialize to. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">version</td><td>Version information (optional and not used here). </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_bitflip_mutator_8h_source.html#l00076">76</a> of file <a class="el" href="_bitflip_mutator_8h_source.html">BitflipMutator.h</a>.</p>

<p class="reference">References <a class="el" href="structshark_1_1_bitflip_mutator.html#a799d19ef46cefd24798a26fdbef8f6d2">m_mutationStrength</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a799d19ef46cefd24798a26fdbef8f6d2" name="a799d19ef46cefd24798a26fdbef8f6d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a799d19ef46cefd24798a26fdbef8f6d2">&#9670;&#160;</a></span>m_mutationStrength</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double shark::BitflipMutator::m_mutationStrength</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_bitflip_mutator_8h_source.html#l00080">80</a> of file <a class="el" href="_bitflip_mutator_8h_source.html">BitflipMutator.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="structshark_1_1_bitflip_mutator.html#ae4709fc7f40d17f105534b348f925e17">init()</a>, <a class="el" href="structshark_1_1_bitflip_mutator.html#a05a38dc09241ab2eda7c7ff3c2a0593f">operator()()</a>, and <a class="el" href="structshark_1_1_bitflip_mutator.html#aba44f8e8cf6821f292275159de2f6a38">serialize()</a>.</p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>include/shark/Algorithms/DirectSearch/Operators/Mutation/<a class="el" href="_bitflip_mutator_8h_source.html">BitflipMutator.h</a></li>
</ul>
</div><!-- contents -->
</div>
</body>
</html>
